import request from '@/utils/request'
// 登录
export function login(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}
export const getuserinfo = () => {
  return request({
    url: '/sys/profile',
    method: 'post'
  })
}
// 获取员工基本信息
export const userPic = (id) => {
  return request({
    url: `/sys/user/${id}`,
    method: 'get'
  })
}
// 修改员工基本信息
export const upuser = (data) => {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
// 获取员工详情信息
export const getuse = (id) => {
  return request({
    url: `/employees/${id}/personalInfo`,
    method: 'get'
  })
}
// 保存员工详情信息
export const userinfo = (data) => {
  return request({
    url: `/employees/${data.id}/personalInfo`,
    method: 'put',
    data
  })
}

// 获取员工岗位信息
export const jobinfo = (id) => {
  return request({
    url: `/employees/${id}/jobs`
  })
}
// 更改员工岗位信息
export const jobedit = (data) => {
  return request({
    url: `/employees/${data.id}/jobs`,
    method: 'put',
    data
  })
}

// 给员工分配角色
export const uprole = (data) => {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
